We calculate the different subsequence end with ith index.
1 2 3 4 5 6 7 8
dp0[i] -> stands for from begin to ith index, subsequence number end with 0 dp1[i] -> stands for from begin to ith index, subsequence number end with 1
dp1[i] = dp1[i-1] + dp0[i-1] + 1 (for ith is 1) dp1[i] = dp1[i-1] (for ith is 0)
dp0[i] = dp1[i-1] + dp0[i-1] (for ith is 0) dp0[i] = dp0[i-1] (for ith is 1)